<?php
namespace app\service;

class Config
{

    use Instance;

    /**
     * @var array
     */
    public $data = [];

    public function get(string $fileName)
    {
        if(!isset($this->data[$fileName])){
            $filePath = CONFIG_PATH.DIRECTORY_SEPARATOR.$fileName.'.php';
            if(!is_file($filePath)){
                $this->data[$fileName] = [];
            }else{
                $this->data[$fileName] = require $filePath;
            }
        }
        return $this->data[$fileName];
    }
}